Programming with QuickTime VR

| Previous | Chapter contents | Chapter top | Section top | Next |

Specifying a Movie Controller

When you create a QuickTime VR movie, you need to add a special piece of user data that identifies which movie controller to invoke for this movie. The movie controller type for QuickTime VR 2.0 movies is 'qtvr' . This user data is examined by the Movie Toolbox when an application calls the NewMovieController function for that movie. Listing 4-1 shows how to add the appropriate user data to a new movie.

Listing 1 Specifying the QuickTime VR movie controller

UserData            myUserData;
OSType              controllerSubType = FOUR_CHAR_CODE('qtvr';

myUserData = GetMovieUserData(theMovie);
SetUserDataItem(myUserData, &controllerSubType,
    sizeof(controllerSubType), kQTControllerType, kQTControllerID);

The constants kQTControllerType and kQTControllerID are defined by QuickTime VR:

enum {
    kQTControllerType                           = FOUR_CHAR_CODE('ctyp').
    kQTControllerID                             = 1
};

 


© 1997 Apple Computer, Inc.

| Previous | Chapter contents | Chapter top | Section top | Next |